<?php
class layout
{
    public static function init(array $data = array())
    {
        $default = array(
            'layout'    => 'main'
        );

        $data = array_merge($default, $data);
        if (!empty($data['layout']) && file_exists(conf::$layout.$data['layout'].'.php'))
        {
            foreach ($data as $k => $v)
            {
                if ($k != 'layout')
                {
                    $$k = $v;
                }
            }
            include conf::$layout.$data['layout'].'.php';
        }
        return false;
    }
}
